﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using com.ClickCricket.dal;

/// <summary>
/// Summary description for MatchService
/// </summary>
/// 
namespace com.ClickCricket.bll
{
    public class MatchService
    {
        private static MatchService instance;

        public static MatchService Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new MatchService();
                }
                return instance;
            }
        }

        private readonly IMatchProvider MatchProvider;

        public MatchService(IMatchProvider MatchProvider)
        {
            this.MatchProvider = MatchProvider;
        }

        public MatchService()
            : this(new MatchLinqProvider())
        {

        }

        internal List<Match> getMatches(int SeriesID)
        {
            return MatchProvider.getMatches(SeriesID);
        }

        internal bool getOnGoingSeries(int SeriesID)
        {
            return MatchProvider.getOnGoingSeries(SeriesID);
        }

        internal bool getUpComingSeries(int SeriesID)
        {
            return MatchProvider.getUpComingSeries(SeriesID);
        }

        public List<Match> GetMatches(int seriesID)
        {
            return MatchProvider.GetMatches(seriesID);
        }

        internal bool getCompletedSeries(int SeriesID)
        {
            return MatchProvider.getCompletedSeries(SeriesID);
        }
    }
}
